/*
 * @lc app=leetcode.cn id=342 lang=cpp
 *
 * [342] 4的幂
 */

// @lc code=start
class Solution {
    // ??????????????????Long long????????int??????
    // ???unsigned int ??,???????Int??????????????Int???????unsigned int
    // ?????4???????????4????????1???????
    // return num > 0 && !(num & (num - 1)) && (num & 0x55555555) == num;????
public:
    bool isPowerOfFour(int num) {
        vector<unsigned int> ans=pow();
        auto it=find(ans.begin(),ans.end(),num);
        return it!=ans.end();
    }
    vector<unsigned int> pow(){
        unsigned int n=15,a=1;
        vector<unsigned int> ans;
        for(int i=0;i<=n;i++){
            ans.push_back(a);
            a*=4;
        }
        return ans;
    }
};
// @lc code=end

